<?php

namespace frontend\modules\yii2\controllers;

use yii\web\Controller;

/**
 * Default controller for the `yii2` module
 */
class IController extends Controller
{
    public $layout = 'main-yii';

    /**
     * 一层目录路由：http://127.0.0.1/docs/structure
     * @param $level1 : structure
     * @return string
     */
    public function actionLevel1($level1){
        return $this->render($level1);
    }

    /**
     * 两层目录路由：http://127.0.0.1/docs/structure/controller
     * @param $level1 : structure
     * @param $level2 : controller
     * @return string
     */
    public function actionLevel2($level1, $level2){
        return $this->render($level1 . "-" . $level2);
    }

    /**
     * 三层目录路由：http://127.0.0.1/docs/structure/controller/web
     * @param $level1 : structure
     * @param $level2 : controller
     * @param $level3 : web
     * @return string
     */
    public function actionLevel3($level1, $level2, $level3){
        return $this->render($level1 . "-" . $level2 . "-" . $level3);
    }

}